package com.common.client;

import com.common.shared.model.Classifier;
import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.widgets.IButton;
import com.smartgwt.client.widgets.Window;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.TextItem;
import com.smartgwt.client.widgets.layout.HLayout;

public class WClassifier extends Window {

	private TextItem tfValue;
	private Classifier classifier;

	public WClassifier(Classifier cl) {
		super();
		setIsModal(true);
		if (cl == null)
			cl = new Classifier();
		classifier = cl;
		DynamicForm form = new DynamicForm();
		tfValue = new TextItem();
		tfValue.setTitle("მნიშვნელობა");
		tfValue.setValue(classifier.getTypename());
		form.setFields(tfValue);
		this.addMember(form);
		HLayout layo = new HLayout();
		layo.setAlign(Alignment.RIGHT);
		IButton bOk = new IButton("Ok", new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {

			}
		});
		IButton bCancel = new IButton("Cancel", new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				WClassifier.this.destroy();
			}
		});
		layo.addMember(bOk);
		layo.addMember(bCancel);
		this.addMember(layo);
		setSize("300", "200");
	}

}
